import { req_info_music_lyric_upload } from '../../Classes/cla_req_info_music_lyric_upload';

import fs from 'fs-extra';
import {
  get_file_cur_lyric,
  get_file_cur_lyric_time,
} from './Func/get_file_path_cur_lyric';

/**
 * 记录 音频 文件 信息
 * @param cur_info
 * @param file
 */
export function set_file_music_lyric_upload(
  cur_info: req_info_music_lyric_upload,
  file: Express.Multer.File
) {
  let file_buffer = file.buffer;

  let file_path = get_file_cur_lyric(cur_info);

  let file_path_time = get_file_cur_lyric_time(cur_info);

  fs.outputFile(file_path, file_buffer);

  fs.outputFile(file_path_time, file_buffer);
}
